Ext.namespace("AuditPlan.Main");

AuditPlan.Main.tabIndex = {
	"toaudit" : 0,
	"audited": 1,
	"reported" : 2,
	"closed" : 3
};
AuditPlan.Main.tabs = [];

AuditPlan.initUI = function() {
	var opentab = Utils.getParameter('opentab');
	if (!opentab) opentab = "toaudit";
	
	// init tabs
	AuditPlan.Main.tabs.push(new AuditPlan.ToAudit());
	AuditPlan.Main.tabs.push(new AuditPlan.Audited());	
	AuditPlan.Main.tabs.push(new AuditPlan.Reported());
	AuditPlan.Main.tabs.push(new AuditPlan.Closed());
	
	AuditPlan.instance = new Ext.TabPanel({
		region: 'center',
		activeTab: AuditPlan.Main.tabIndex[opentab],
		items: AuditPlan.Main.tabs
	});
	
	var mainview = new Ext.Viewport({
        layout:'border',
        items:[AuditPlan.instance]
    });
};

Ext.onReady(function(){
	Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
	AuditPlan.initUI();
});